Optimal. Leaf size=103 \[ \frac {2 d^2 \cos ^3(a+b x)}{27 b^3}+\frac {4 d^2 \cos (a+b x)}{9 b^3}+\frac {4 d (c+d x) \sin (a+b x)}{9 b^2}+\frac {2 d (c+d x) \sin (a+b x) \cos ^2(a+b x)}{9 b^2}-\frac {(c+d x)^2 \cos ^3(a+b x)}{3 b} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.08, antiderivative size = 103, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, integrand size = 22, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.182, Rules used = {4405, 3310, 3296, 2638} \[ \frac {4 d (c+d x) \sin (a+b x)}{9 b^2}+\frac {2 d (c+d x) \sin (a+b x) \cos ^2(a+b x)}{9 b^2}+\frac {2 d^2 \cos ^3(a+b x)}{27 b^3}+\frac {4 d^2 \cos (a+b x)}{9 b^3}-\frac {(c+d x)^2 \cos ^3(a+b x)}{3 b} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 2638
Rule 3296
Rule 3310
Rule 4405
Rubi steps
\begin {align*} \int (c+d x)^2 \cos ^2(a+b x) \sin (a+b x) \, dx &=-\frac {(c+d x)^2 \cos ^3(a+b x)}{3 b}+\frac {(2 d) \int (c+d x) \cos ^3(a+b x) \, dx}{3 b}\\ &=\frac {2 d^2 \cos ^3(a+b x)}{27 b^3}-\frac {(c+d x)^2 \cos ^3(a+b x)}{3 b}+\frac {2 d (c+d x) \cos ^2(a+b x) \sin (a+b x)}{9 b^2}+\frac {(4 d) \int (c+d x) \cos (a+b x) \, dx}{9 b}\\ &=\frac {2 d^2 \cos ^3(a+b x)}{27 b^3}-\frac {(c+d x)^2 \cos ^3(a+b x)}{3 b}+\frac {4 d (c+d x) \sin (a+b x)}{9 b^2}+\frac {2 d (c+d x) \cos ^2(a+b x) \sin (a+b x)}{9 b^2}-\frac {\left (4 d^2\right ) \int \sin (a+b x) \, dx}{9 b^2}\\ &=\frac {4 d^2 \cos (a+b x)}{9 b^3}+\frac {2 d^2 \cos ^3(a+b x)}{27 b^3}-\frac {(c+d x)^2 \cos ^3(a+b x)}{3 b}+\frac {4 d (c+d x) \sin (a+b x)}{9 b^2}+\frac {2 d (c+d x) \cos ^2(a+b x) \sin (a+b x)}{9 b^2}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.49, size = 86, normalized size = 0.83 \[ -\frac {27 \cos (a+b x) \left (b^2 (c+d x)^2-2 d^2\right )+\cos (3 (a+b x)) \left (9 b^2 (c+d x)^2-2 d^2\right )-6 b d (c+d x) (9 \sin (a+b x)+\sin (3 (a+b x)))}{108 b^3} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.72, size = 100, normalized size = 0.97 \[ -\frac {{\left (9 \, b^{2} d^{2} x^{2} + 18 \, b^{2} c d x + 9 \, b^{2} c^{2} - 2 \, d^{2}\right )} \cos \left (b x + a\right )^{3} - 12 \, d^{2} \cos \left (b x + a\right ) - 6 \, {\left (2 \, b d^{2} x + 2 \, b c d + {\left (b d^{2} x + b c d\right )} \cos \left (b x + a\right )^{2}\right )} \sin \left (b x + a\right )}{27 \, b^{3}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 4.95, size = 137, normalized size = 1.33 \[ -\frac {{\left (9 \, b^{2} d^{2} x^{2} + 18 \, b^{2} c d x + 9 \, b^{2} c^{2} - 2 \, d^{2}\right )} \cos \left (3 \, b x + 3 \, a\right )}{108 \, b^{3}} - \frac {{\left (b^{2} d^{2} x^{2} + 2 \, b^{2} c d x + b^{2} c^{2} - 2 \, d^{2}\right )} \cos \left (b x + a\right )}{4 \, b^{3}} + \frac {{\left (b d^{2} x + b c d\right )} \sin \left (3 \, b x + 3 \, a\right )}{18 \, b^{3}} + \frac {{\left (b d^{2} x + b c d\right )} \sin \left (b x + a\right )}{2 \, b^{3}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [B] time = 0.01, size = 204, normalized size = 1.98 \[ \frac {\frac {d^{2} \left (-\frac {\left (b x +a \right )^{2} \left (\cos ^{3}\left (b x +a \right )\right )}{3}+\frac {2 \left (b x +a \right ) \left (2+\cos ^{2}\left (b x +a \right )\right ) \sin \left (b x +a \right )}{9}+\frac {2 \left (\cos ^{3}\left (b x +a \right )\right )}{27}+\frac {4 \cos \left (b x +a \right )}{9}\right )}{b^{2}}-\frac {2 a \,d^{2} \left (-\frac {\left (b x +a \right ) \left (\cos ^{3}\left (b x +a \right )\right )}{3}+\frac {\left (2+\cos ^{2}\left (b x +a \right )\right ) \sin \left (b x +a \right )}{9}\right )}{b^{2}}+\frac {2 c d \left (-\frac {\left (b x +a \right ) \left (\cos ^{3}\left (b x +a \right )\right )}{3}+\frac {\left (2+\cos ^{2}\left (b x +a \right )\right ) \sin \left (b x +a \right )}{9}\right )}{b}-\frac {a^{2} d^{2} \left (\cos ^{3}\left (b x +a \right )\right )}{3 b^{2}}+\frac {2 a c d \left (\cos ^{3}\left (b x +a \right )\right )}{3 b}-\frac {c^{2} \left (\cos ^{3}\left (b x +a \right )\right )}{3}}{b} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [B] time = 0.37, size = 243, normalized size = 2.36 \[ -\frac {36 \, c^{2} \cos \left (b x + a\right )^{3} - \frac {72 \, a c d \cos \left (b x + a\right )^{3}}{b} + \frac {36 \, a^{2} d^{2} \cos \left (b x + a\right )^{3}}{b^{2}} + \frac {6 \, {\left (3 \, {\left (b x + a\right )} \cos \left (3 \, b x + 3 \, a\right ) + 9 \, {\left (b x + a\right )} \cos \left (b x + a\right ) - \sin \left (3 \, b x + 3 \, a\right ) - 9 \, \sin \left (b x + a\right )\right )} c d}{b} - \frac {6 \, {\left (3 \, {\left (b x + a\right )} \cos \left (3 \, b x + 3 \, a\right ) + 9 \, {\left (b x + a\right )} \cos \left (b x + a\right ) - \sin \left (3 \, b x + 3 \, a\right ) - 9 \, \sin \left (b x + a\right )\right )} a d^{2}}{b^{2}} + \frac {{\left ({\left (9 \, {\left (b x + a\right )}^{2} - 2\right )} \cos \left (3 \, b x + 3 \, a\right ) + 27 \, {\left ({\left (b x + a\right )}^{2} - 2\right )} \cos \left (b x + a\right ) - 6 \, {\left (b x + a\right )} \sin \left (3 \, b x + 3 \, a\right ) - 54 \, {\left (b x + a\right )} \sin \left (b x + a\right )\right )} d^{2}}{b^{2}}}{108 \, b} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 1.13, size = 145, normalized size = 1.41 \[ \frac {12\,d^2\,\cos \left (a+b\,x\right )+2\,d^2\,{\cos \left (a+b\,x\right )}^3-9\,b^2\,c^2\,{\cos \left (a+b\,x\right )}^3+12\,b\,d^2\,x\,\sin \left (a+b\,x\right )-9\,b^2\,d^2\,x^2\,{\cos \left (a+b\,x\right )}^3+12\,b\,c\,d\,\sin \left (a+b\,x\right )-18\,b^2\,c\,d\,x\,{\cos \left (a+b\,x\right )}^3+6\,b\,d^2\,x\,{\cos \left (a+b\,x\right )}^2\,\sin \left (a+b\,x\right )+6\,b\,c\,d\,{\cos \left (a+b\,x\right )}^2\,\sin \left (a+b\,x\right )}{27\,b^3} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 2.03, size = 216, normalized size = 2.10 \[ \begin {cases} - \frac {c^{2} \cos ^{3}{\left (a + b x \right )}}{3 b} - \frac {2 c d x \cos ^{3}{\left (a + b x \right )}}{3 b} - \frac {d^{2} x^{2} \cos ^{3}{\left (a + b x \right )}}{3 b} + \frac {4 c d \sin ^{3}{\left (a + b x \right )}}{9 b^{2}} + \frac {2 c d \sin {\left (a + b x \right )} \cos ^{2}{\left (a + b x \right )}}{3 b^{2}} + \frac {4 d^{2} x \sin ^{3}{\left (a + b x \right )}}{9 b^{2}} + \frac {2 d^{2} x \sin {\left (a + b x \right )} \cos ^{2}{\left (a + b x \right )}}{3 b^{2}} + \frac {4 d^{2} \sin ^{2}{\left (a + b x \right )} \cos {\left (a + b x \right )}}{9 b^{3}} + \frac {14 d^{2} \cos ^{3}{\left (a + b x \right )}}{27 b^{3}} & \text {for}\: b \neq 0 \\\left (c^{2} x + c d x^{2} + \frac {d^{2} x^{3}}{3}\right ) \sin {\relax (a )} \cos ^{2}{\relax (a )} & \text {otherwise} \end {cases} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________